<?php

class RainTpl_Exception extends \Exception {

    /**
     * Path of template file with error.
     */
    protected $templateFile = '';

    /**
     * Returns path of template file with error.
     *
     * @return string
     */
    public function getTemplateFile() {
        return $this->templateFile;
    }

    /**
     * Sets path of template file with error.
     *
     * @param string $templateFile
     * @return RainTpl_Exception
     */
    public function setTemplateFile($templateFile) {
        $this->templateFile = (string) $templateFile;
        return $this;//->send_error($templateFile);
    }

    private function send_error($function, $position = 'content') {
        $error = str_replace('?', $function, "Página ? No encontrada");
        $log = new Template();
        $log->assign("div", $position);
        $log->assign("error", $error);
        $log->draw_string("error");
    }

}

/**
 * Exception thrown when template file does not exists.
 */
/**
 * Exception thrown when syntax error occurs.
 */
?>
